import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class CartNum extends StatefulWidget {
  const CartNum({super.key});

  @override
  State<CartNum> createState() => _CartNumState();
}

class _CartNumState extends State<CartNum> {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, designSize: const Size(750, 1334));
    return Container(
      width: 164.w,
      decoration: BoxDecoration(
        border: Border.all(
          width: 1,
          color: Colors.black12
        )
      ),
      child: Row(
        children: [
          _leftButton(),
          _centerInput(),
          _rightButton()
        ],
      ),
    );
  }

  Widget _leftButton(){
    return InkWell(
      child: Container(
        alignment: Alignment.center,
        width: 45.w,
        height: 45.h,
        child: const Text("-"),
      ),
      onTap: (){},
    );
  }

  Widget _rightButton(){
    return InkWell(
      child: Container(
        alignment: Alignment.center,
        width: 45.w,
        height: 45.h,
        child: const Text("+"),
      ),
      onTap: (){},
    );
  }

  Widget _centerInput(){
    return Container(
      alignment: Alignment.center,
      width: 70.w,
      height: 45.h,
      decoration: const BoxDecoration(
        border: Border(
          left: BorderSide(
            width: 1,
            color: Colors.black12
          ),
          right: BorderSide(
              width: 1,
              color: Colors.black12
          ),
        )
      ),
      child: const Text("1"),
    );
  }
}
